﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace YunCMS.Common
{
    public static class Const
    {
        #region const

        public static readonly string _reportString = "";
        public static readonly string USER_AUTHORITY = "USER_AUTHORITY";
        public static readonly string USER_INFO = "USER_INFO";

        public static readonly string MQeuryWhere = " Active=1 and IsHomePage=1";
        public static readonly string CQeuryWhere = " Active=1";

        #endregion

        public static Dictionary<string, string> _modules = null;

        private static string _connectionString = string.Empty;

        public static string ConnectionString
        {
            get { 
                
                if (string.IsNullOrEmpty(_connectionString))
                {
                    _connectionString = ConfigurationManager.ConnectionStrings["connectionString"].ConnectionString;
                }
                return _connectionString;
            }
            set
            {
                _connectionString = value;
            }
        }

        /// <summary>
        /// Hard-code in const class
        /// </summary>
        public static Dictionary<string,string> Modules
        {
            get
            {
                if (_modules == null)
                {
                    _modules = new Dictionary<string, string>();
                    _modules.Add("Artical", "文章模块");
                    _modules.Add("Image", "图片模块");
                    _modules.Add("Media", "视频模块");
                    _modules.Add("Product", "产品模块");
                    _modules.Add("Download", "下载模块");
                    _modules.Add("Page", "单页模块");
                }
                return _modules;
            }
        }   
    }
}
